<template>
        <el-form ref="form" label-width="100px" :model="form" :inline="inline">
            <el-form-item v-for="v in formLabel" :key="v.label" :label="v.label">
                <el-input v-if="v.type=='input'" :placeholder="'请输入'+v.label" v-model="form[v.model]"></el-input>
                <el-switch v-if="v.type=='switch'" v-model="form[v.model]"></el-switch>
                <el-date-picker v-if="v.type=='date'" type="date" value-format="yyyy-mm-dd" placeholder="选择日期" v-model="form[v.model]"></el-date-picker>
                <el-select v-if="v.type=='select'" placeholder="请选择" v-model="form[v.model]">
                <el-option v-for="i in v.opts" :key="i.value" :label="i.label" :value="i.value"></el-option>
                </el-select>
            </el-form-item>
            <el-form-item><slot></slot></el-form-item>
        </el-form>
</template>

<script>
    export default {
        name:'CommonForm',
        props:{
            formLabel:Array,
            form:Object,
            inline:Boolean
        },
        data() {
            return {
                
            }
        },
    }
</script>

<style lang="scss" scoped>

</style>